package com.ctgu.蓝桥杯真题.B组2014;

import java.util.Scanner;

/**
 * @author: Backdiy
 * @data: 2021/4/15 20:11
 * @desc:
 */
public class 武功秘籍1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m =scanner.nextInt();
        int i = (m - n + 2) / 2;
        if (n%2!=0&&m%2==0){
            i++;
        }
        System.out.println(i);
    }
}
